from devicelist import devicelist
from telnet_client import *
from config_bkp import *

for device in range(len(devicelist)):
    plat = devicelist[device]['platform']
    name1 = devicelist[device]['name']
    ip1 = devicelist[device]['ip']
    username1 = devicelist[device]['username']
    password1 = devicelist[device]['password']
    if plat == 'IOS':
        a = cisco(name1,ip1,username1,password1)
    elif plat == 'VRP':
        a = huawei(name1,ip1,password1)

    config_bkp(name1,a)
else:
    print('='*80)
    print('Mission accomplished.')
    print('='*80)